use std::fs::File;

pub struct FileParser {
    path: String,
    file: File
}

impl FileParser {
    pub fn new(path: &str) -> FileParser {
        println!("file path is {}", path);
        FileParser {
            path: String::from(path),
            file: File::open(path).expect("文件路径错误，文件不存在")
        }
    }
}

impl FileParser {
    pub fn get_file(&self) -> &File {
        &self.file
    }
}